<template>
  <div class=" container">
    <TopNav />

    <div class="content ">
      <div class="margin-20">
        <div class=" slider-down">
          <div class="progress">参观登记确认 当前已完成进度：100%</div>
          <van-progress :percentage="100" stroke-width="10" />
        </div>
        <div class="tips fz-12 slider-down delay7">
          以下信息将用于向您精准推荐符合您兴趣和业务需求的对口展商及产品，协助您提升参观效率
        </div>

        <div class="slider-down delay9">
          <QuestionBank />
        </div>
        <van-tabs v-model="active" class="tab slider-down delay11">
          <van-tab title="推荐新同事">
            <div :class="setClassL">

              <div class="newColleague " v-for="(parentData,i) in formData" :key="i" v-if="parentData">
                <i class="iconfont iconguanbi" @click="removeFriend(i)" v-if="i!=0"></i>
                <van-form class="form" ref="form">
                  <template v-for="(item,i1) in parentData">
                      <van-field :key="i1" :value="item.value" v-model="item.value" :readonly="item.readonly" :label="item.label" :type="item.type" :placeholder="item.placeholder" :rules="!item.readonly?item.rules:[]" />
                  </template>
                  <van-button v-if="formData.length-1==i && formData.length<5" class="add" round icon="plus" type="primary" @click="addFriend">点击添加好友</van-button>
                </van-form>
              </div>

            </div>
          </van-tab>
          <van-tab title="已推荐">
            <ul class="recommend" :class="setClassR">
              <li>
                <span>姓名</span>
                <span>手机</span>
                <span>电子邮箱</span>
              </li>

              <li class="no">暂无</li>
            </ul>
          </van-tab>
        </van-tabs>

        <van-button block round native-type="submit" class="submit slider-down delay13" @click="submit">提交</van-button>

      </div>

    </div>
  </div>
</template>
<script lang="ts">
import visitorRegistration from "./visitorRegistration";
export default visitorRegistration;
</script>
<style lang="scss" scoped>
.tab {
  margin-bottom: 20px;
  ::v-deep .van-tabs__wrap {
    border-bottom: 1px solid #eee;
  }
  .slideInLeft {
    animation: 0.3s slideInLeft cubic-bezier(0.68, -0.55, 0.265, 1);
  }
  .slideInRight {
    animation: 0.3s slideInRight cubic-bezier(0.68, -0.55, 0.265, 1);
  }
  @keyframes slideInLeft {
    from {
      transform: translateX(-100%);
    }
    to {
      transform: translateX(0);
    }
  }
  @keyframes slideInRight {
    from {
      transform: translateX(100%);
    }
    to {
      transform: translateX(0);
    }
  }
  .newColleague {
    border: 1px solid #eee;
    margin-bottom: 10px;
    position: relative;
    &:first-child{
        border-top: none;
    }
    .iconguanbi {
      position: absolute;
      z-index: 2;
      right: 0px;
      top: 0px;
      padding: 6px 8px;
      font-size: 13px;
      background: #eee;
      color: #fff;
      border-radius: 0 0 0 12px;
    }
    .add {
      margin: 20px auto;
      display: block;
    }
  }
  .recommend {
    li {
      display: flex;
      font-size: 12px;
      line-height: 30px;
      &.no {
        justify-content: center;
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
      }
      span {
        border-left: 1px solid #eee;
        display: block;
        flex: 1;
        padding: 0 10px;

        &:nth-child(3) {
          border-right: 1px solid #eee;
          flex: 2;
        }
      }
      border-bottom: 1px solid #eee;
    }
  }
}
.submit {
  margin: 30px 0;
}
</style>